home *** CD-ROM | disk | FTP | other *** search
/ Learn Microsoft Visual Basic 6.0 Now / Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO / media / chap07 / b07d005.cc2 < prev    next >
Text File  |  1998-06-07  |  3KB  |  66 lines

  1. 0, In this demonstration I'll add a second 
  2. 3, form to the Online Shopper program I 
  3. 5, created in Chapter 2. The Online Shopper 
  4. 8, program is a graphical ordering program 
  5. 11, well-suited to the Internet or an on-line 
  6. 13, ordering environment. As I explored 
  7. 17, earlier, I can click various buttons and 
  8. 20, create new features in my order. I'm 
  9. 24, running the program now, and realizing how 
  10. 25, nice it would be if my customers had a way 
  11. 28, of getting more information about 
  12. 29, placing their order. So, I'll create a 
  13. 32, Questions button that opens such a window in 
  14. 35, this area. And I'll create a new form with 
  15. 40, the Visual Basic Add Form command. 
  16. 43, First, I'll close the program, and then I'll 
  17. 48, create a new form by clicking the Add 
  18. 50, Form command on the Project menu. The Add 
  19. 56, Form dialog box contains the predefined 
  20. 59, forms that Visual Basic offers. Since I 
  21. 62, want to create a blank regular form, 
  22. 64, I'll click the Open button with Form 
  23. 66, highlighted. In my programming environment, I 
  24. 72, have a new form, and I can resize it to 
  25. 75, be the size of an order window. It will 
  26. 77, be a pop-up window about this size. 
  27. 82, Now, I can give the new form a title by 
  28. 86, opening the Properties window. I'll change 
  29. 92, the caption to Contacting Us. And I'll 
  30. 101, create a label on my form to display 
  31. 103, information and a Command button, so that I 
  32. 110, can close the window. I'll give the 
  33. 115, Command button the name Close. And in the 
  34. 125, label object, this message should clearly 
  35. 127, spell out our ordering and shipping 
  36. 129, policy. Now, I'll double-click the Close 
  37. 131, button to close the Message window in my 
  38. 135, program. I'll type the code Form2.Hide to 
  39. 140, use the Hide method to close the second 
  40. 142, form in the program. And I'll close the 
  41. 145, second code window, and go back to the 
  42. 147, first form in the program, and create a 
  43. 151, second Command button called Questions, 
  44. 154, that will open the second form. And I'll 
  45. 157, set its property to Questions. Now, I'll 
  46. 165, add the program code to the Questions 
  47. 166, button. This program code will open the 
  48. 171, second form when the user clicks the 
  49. 172, button in the program. First, I'll load Form 
  50. 178, 2. And then I'll show Form 2. Now that 
  51. 193, I have my complete program code, I'll 
  52. 195, run the program. And in the Visual Basic 
  53. 204, programming environment, I can manipulate 
  54. 208, my program as I usually do. I can add 
  55. 211, features to the program. And when I want 
  56. 214, to know some answers to my questions, I 
  57. 216, can click the Questions button. 
  58. 218, Immediately, Visual Basic displays a form on the 
  59. 220, screen that shows my 24-hour day 
  60. 222, contact information. And when I'm done using 
  61. 225, the Contact Message box, I can click 
  62. 228, Close and close it. And any time I can open 
  63. 231, it up again. So, in this demonstration 
  64. 235, you've seen how to add a second form to 
  65. 237, your program.
  66. 238, END